﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace MPlayer.DotNet.WindowsForms
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();

            MPlayerContext.ExecutablePath = "player";
            MPlayerContext.Initialize((int)panel1.Handle);
        }

        private void Button1Click(object sender, EventArgs e)
        {
            var result = openFileDialog1.ShowDialog();
            if (result == DialogResult.OK)
            {
                MPlayerContext.OpenFile(openFileDialog1.FileName);
            }
        }

        private void Form1FormClosing(object sender, FormClosingEventArgs e)
        {
            MPlayerContext.CloseAll();
        }
    }
}
